import { createStore } from "vuex";

export default createStore({
  state: {
    BottomState: "home",
    SlideOptionIndex: 0,
    ClickOptionIndex:0,
    NowIndex: 0,
  },
  getters: {},
  mutations: {
    changeState(state, value) {
      state.BottomState = value;
    },
    changeslideindex:function(state, value) {
      state.SlideOptionIndex = value;
    },
    changeNowIndex(state, value){
      
      state.NowIndex=value
    },
    clickslideindex:function(state, value) {
      console.log(state.NowIndex);
      console.log(value);
      if (value > state.NowIndex) {
      
     state.ClickOptionIndex = Number(value) - 1;
      } else{
        state.ClickOptionIndex = value
      }
      
    }
  },
  actions: {},
  modules: {},
});
